package com.itnoob.type;

/**
 * 支付枚举类
 * @author zhoujun
 * @date 2025/3/19 23:48
 */
public enum PayTypeEnum {

    WECHAT_PAY("1","WECHAT_PAY")
    ,ALI_PAY("2","ALI_PAY");

    String code;
    String value;

    PayTypeEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public  static PayTypeEnum  fromPayTypeEnum(String code){
        PayTypeEnum[] values = PayTypeEnum.values();
        for (PayTypeEnum value : values) {
            if (value.getCode().equals(code)){
                return value;
            }
        }
        throw  new IllegalArgumentException("PayTypeEnum not contains :" +  code);
    }

}
